﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Open.Sina2SDK;

namespace olierFrm.OAuth.Controllers
{
    public class SinaController : Controller
    {
        //
        // GET: /Sina/
        SinaSerive serive = new SinaSerive();
        public JsonResult Index()
        {

            string type = Request.QueryString["type"];
            if (type != null && type == "code")
            {
                serive.GetAuthorizationCode();
            }
            else
            {
                
                serive.GetAccessTokenByAuthorizationCode(Request["code"]);
            }
            return null;
        }

    }
}
